<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <script type="text/javascript" src="__JS__/rem.js"></script>
    <script type="text/javascript" src="__JS__/jquery-1.8.0.min.js"></script> 
          <script src="__SALEMAN__/js/zepto.min.js"></script>
        <link href="http://cdn.bootcss.com/weui/1.0.2/style/weui.min.css" rel="stylesheet">
    <link type="text/css" rel="stylesheet" href="__CSS__/public.css" />
    <link type="text/css" rel="stylesheet" href="__CSS__/clinic.css" />
    <title>订单详情</title>
    <style type="text/css">
    .input-address-box{
      width: 100%;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      min-width: 320px;
      max-width: 640px;
      overflow: hidden;
  
      margin-bottom: 15px;
  }
    .input-address-box .adrees-txt{
        width: 100px;
        font:normal 14px/26px 'Microsoft YaHei';
        color:#000;
        float:left;
        text-align: left;
        padding-left: 15px;
        box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
    }
    .input-address-box .adress-box{
      width: 100%;
      padding-left: 95px;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
    
    }
    .input-address-box .input-address{
      margin-bottom: 5px;
    
    }
    .input-address-box input{
      font:normal 14px/16px 'Microsoft YaHei';
      width: 90%;
      padding: 5px 10px;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      border:1px solid #ccc;
      border-radius: 3px;
      display: block;
    }
    .input-address-box .address-used{
      padding: 0 5px;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
    }
    .input-address-box .address-used p{
     font:normal 12px/16px 'Microsoft YaHei';
     padding-left: 10px;
     padding: 5px 10px;
     border-bottom:1px dashed #ccc;
    }

    </style>
</head>

<body>
    <div class="P_Header">
        <div class="P_main">
            <h2 class="P_title">订单详情</h2>
            <span class="P_goBack"><!--<a href="/Doctor/Clinic/Clinic/order.html"><img src="/Public/Home/Saleman/images/back_icon.png" alt="" style="width:10px;height:20px;"></a>-->
                <a href="/Doctor/Clinic/Clinic/order.html" id="my_back_btn"><i></i></a>
            </span>
        </div>
    </div>
    <div class="P_con orderDet">
        <div class="input-address-box">
   <div class="adrees-txt">请输入地址：</div>
   <div class="adress-box">
        <div class="input-address">
             <input type="text" placeholder="输入您的常用地址" value="" id="use-address">
        </div>
        <div class="address-used" style="display:none;">
           <volist name="address" id="data">
           <p class="address">{$data['address']}</p>
           </volist>
        </div>
   </div>
</div>

        <div class="floor2 bg_f" style="padding-bottom:0">
            <div class="P_main">
                <div class="tableBox">
                    <ul class="dis_box tableTit">
                        <li class="li_25">药品名称</li>
                        <li class="li_20">数量</li>
                        <li class="li_20">单价</li>
                        <li class="li_20">总价</li>
                        <li class="li_15"></li>
                    </ul>
                    <volist name="list" id="data">
                    <ul class="dis_box">
                        <li class="li_25">{$data.drugs_name}</li>
                        <li class="li_20">{$data.num}</li>
                        <li class="li_20 c_red">￥{$data.price}</li>
                        <li class="li_20 c_red">￥{$data.totalPrice}</li>
                        <li class="li_15 c_999"   data="{$data.drugs_id}"><i>&#xe63d;</i></li>
                    </ul>
                      </volist>                                 
                </div>
                <div class="totalMoney singleLine" >商品总额：<em class="c_red">￥<?php echo $totalPrice;?></em></div>
            </div>
        </div>
        <div class="pad_l_r">
            <div class="bBth blue"><a href="javascript:void(0)" id="success">完成</a></div>
        </div>
    </div>  

</body>
</html>
<include file="./Application/Home/View/default/Saleman/Public/popup.html"/>
<script>
$(function(){
       function back_callback() {
    history.go(-1);
}
       $(".li_15").click(function(){

           
            var drugs_id = $(this).attr('data');
                    $.ajax({
                        url: "/Doctor/Clinic/Clinic/setelOrder/op/delete",
                        type: 'post',
                        data: {drugs_id: drugs_id},
                        dataType: "json",
                        success: function (result) {
                           $("#iosDialog1").hide(200);
                            $('#iosDialog2').find('.sure-info').html(result['msg']);
                            $('#iosDialog2').show(200);
                        }
                    });

       })
       $("#success").click(function(){
           var address = $("#use-address").val();
          
           $.ajax({
                        url: "/Doctor/Clinic/Clinic/setelOrder/op/submit",
                        type: 'post',
                        data: {address: address},
                        dataType: "json",
                        success: function (result) {

                            $("#iosDialog1").hide(200);
                            $('#iosDialog2').find('.sure-info').html(result['msg']);
                            
                           $('#iosDialog2').show(200);
                            
                            $(".weui-dialog__btn_primary").click(function(){
                             window.location.href="/Doctor/Clinic/Clinic/order.html";

                            })
                        }
                    });

       })
       $("#use-address").focus(function(){

          $(".address-used").show();
         
          $(".address").click(function(){
              var address = $(this).text();
              $("#use-address").val(address);
          })
        
       })
      
})
</script>